﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="travel-result.aspx.cs" Inherits="travel_travel_result" MasterPageFile="~/travel/MobileTravel.master" Async="true" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
<form id="form1" runat="server">
<section>
<header id="header">
<nav id="nav">
<a href="../default.aspx"><div class="branding"></div></a>
<div class="navpages">
<a href="travel-quote.aspx">
<asp:Image ID="imgTop" runat="server" ImageUrl="../images/button/topnav-back.png" width="49" height="29" border="0" alt="back" BorderWidth="0"  /></a>
</div>
</nav>
</header>
</section>
<section id="body">
<div class="body">
<h1>Travel Insurance Quote</h1>
<br/>
<div class="form">
<div class="topResults"></div>
<div class="body">
<div class="pad">
<asp:Label runat="server" ID="lblNoResultMessage" Font-Bold="true" Text="" />
<asp:DataList runat="server" ID="dlTravelResults" CssClass="center"
        onitemdatabound="dlTravelResults_ItemDataBound" 
        onitemcommand="dlTravelResults_ItemCommand">        
<ItemTemplate>
<!-- Quote Item | Starts -->
<div class="quoteItem">
<div class="header"></div>
<div class="headerTitle">
<div class="pad" style="padding-top:4px;">
<asp:HyperLink ID="hlnkViewTop" runat="server" NavigateUrl="#">
<div class="left"><asp:Image ID="imgProviderCompanyLogo" runat="server" ImageUrl="~/images/bg/logo.png" AlternateText="" Width="90"/><asp:Label runat="server" Text="Insurer" ID="lblProviderCompanyName" Visible="false"></asp:Label>
</div>
<div class="right price">
<asp:Label runat="server" ID="lblPremiumAmount" Text="-" Font-Bold="true"></asp:Label>

</div>
</asp:HyperLink>


</div>
</div>
<div class="body">
<div class="pad">
<asp:Label runat="server" ID="lblProviderCompanyID" Text="0" Visible="false" />
<asp:Label runat="server" ID="lblTAResultID" Text="0" Visible="false" />

<asp:Label runat="server" Text="Coverage" ID="lblPlanName"></asp:Label>
<div class="separator_7px"></div>

<div class="CallUsNow">
<asp:ImageButton ID="ibtBuyNow" runat="server" ImageUrl="~/images/button/buynow_single.png" AlternateText="Buy Now!" Width="190px" Height="30" BorderWidth="0" />
</div>
<div class="separator_7px"></div>
<div class="EmailQuote">
<asp:ImageButton ID="imgEmailQuote" runat="server" ImageUrl="~/images/button/emailquote_single.png" CommandName="Email" alt="Email Quote" Width="190px" Height="30" BorderWidth="0" />
</div>
<div class="separator_7px"></div>
</div>
</div>
<div class="footer">
<asp:HyperLink ID="hlnkView" runat="server" NavigateUrl="~/travel/travel-result-detail.aspx?" ImageUrl="~/images/button/view-details.png" Width="220px"></asp:HyperLink>
</div>
</div>
<div class="separator_15px"></div>
<!-- Quote Item | Ends -->
</ItemTemplate>
</asp:DataList>
</div>
</div>
<asp:Panel ID="pnlOffline" runat="server" Visible="false" >
<span style="font-size:small;">Engage an insurance broker to find you the best deal by completing the below
<br />Please allow 1-2 working days for the broker team to search the market for competitive quotes.<br />
</span><br />
<asp:TextBox ID="txtVehicleNo" runat="server" Text="Your vehicle number"></asp:TextBox>
<asp:RequiredFieldValidator ID="rfvVehicleNo" runat="server" CssClass="validationErrorControl" ErrorMessage="" InitialValue="Your vehicle number" ValidationGroup="offline" ControlToValidate="txtVehicleNo" Display="Dynamic"></asp:RequiredFieldValidator>
<asp:RequiredFieldValidator ID="rfvVehicleNoSave" runat="server" CssClass="validationErrorControl" ErrorMessage="" ValidationGroup="offline" ControlToValidate="txtVehicleNo" Display="Dynamic"></asp:RequiredFieldValidator>
<%--<asp:Button ID="btnSaveOffline" runat="server" Text="Submit" OnClick="btnSaveOffline_Click" ValidationGroup="offline"/>--%>
</asp:Panel>
<div class="bottom"></div>
<div style="display: none;">
                        <asp:LinkButton runat="server" ID="lnkbtnPopup" Text="click"></asp:LinkButton>
                        <input id="inputProviderId" runat="server" type="hidden" />
                        <input id="inputTAId" runat="server" type="hidden" />
                        <input id="inputPlanType" type="hidden" runat="server" />
                        <input id="inputPlanName" type="hidden" runat="server" />
                        <input id="inputPremium" type="hidden" runat="server" />
                        <input id="inputResultId" type="hidden" runat="server" />
                        <input id="inputNoOfAdult" type="hidden" runat="server" />
                        <input id="inputUserId" type="hidden" />
</div>
</div>
</div>
</section>
</form>

<script type="text/javascript">
    function ManageRedirect(_companyId, _resultid, _annualpremium, _userid, _taid, _planname, _fullname, _mobile, _email, _nric, _title, _ctname2) {

        document.getElementById('<%=inputProviderId.ClientID %>').value = _companyId;
        document.getElementById('<%=inputResultId.ClientID %>').value = _resultid;
        document.getElementById('<%=inputPremium.ClientID %>').value = _annualpremium;
        document.getElementById('<%=inputTAId.ClientID %>').value = _taid;
        document.getElementById('<%=inputPlanName.ClientID %>').value = _planname;
        document.getElementById('inputUserId').value = _userid;
        
        alert("Next page is best viewed on your laptop/PC.");

        if (_companyId == "23" || _companyId == "34" || _companyId == "37" || _companyId == "38" || _companyId == "24") {
            //hsbc, chinataiping, 1cover, directasia 3rd party links

            window.open('redirect.aspx?resultId=' + _resultid + '&providerid=' + _companyId + '&premium=' + _annualpremium + '&userid=' + _userid
            + '&taid=' + _taid + '&nric=' + _nric + '&name2=' + _ctname2 + '&fullname=' + _fullname + '&mobile=' + _mobile
            + '&email=' + _email + '&title=' + _title);
        }
        else {
            window.location.href = "redirecttocx.aspx?mtaid=" + _taid + "&mpid=" + _companyId + "&muid=" + _userid + "&mtarid=" + _resultid
            + "&mpremium=" + _annualpremium + "&mplan=" + _planname;
        }
        
    }

    
    
</script>
</asp:Content>
